package org.liuyunfeng.web;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
import lombok.*;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @description:
 * @author: TanJingyu
 * @create: 2021-11-29 10:50
 **/
@Api(value = "/members/retain", tags = "挽留用户")
@RestController
@RequestMapping("/members/retain")
@RequiredArgsConstructor
public class RetainUserController {

    /**
     * 是否需要弹出挽留用户窗口
     * @param param 判断参数
     * @return {"retain":true}
     */
    @GetMapping
    @ApiOperation(value = "判断当前用户是否需要弹出挽留窗口", notes = "判断当前用户是否需要弹出挽留窗口")
    public Result retain(RetainRequestParam param) {
        return new Result(true);
    }

    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    public static class Result {
        @ApiModelProperty(name = "retain", value = "是否弹出窗口")
        private Boolean retain;
    }


    @Getter
    @Setter
    public static class RetainRequestParam {
        @ApiModelProperty(name = "用户openId", required = true, value = "必须存在")
        private String openId;
        @ApiModelProperty(name = "用户memberId", required = true, value = "必须存在")
        private Integer memberId;
    }

}

    